
      * This is an annotated version of the DRIVER program from the
      * preceding AClass example.

       PROGRAM-ID. DRIVER.
      * This is the "driver" program that exercises the COBOL class from
      * AClass.cbl. Unlike the CLASS-ID paragraph, in isCOBOL the
      * PROGRAM-ID paragraph does not support an optional AS <literal>
      * clause. As a result, the user cannot provide a case-sensitive,
      * externally visible name for the program. By default, the isCOBOL
      * compiler assigns an all-uppercase version of the program ID to
      * the .class file that it generates for the program. Therefore my
      * convention is to use an all-uppercase program ID, and also to
      * give the COBOL source file an all-uppercase name (in this case,
      * DRIVER.cbl).
       ENVIRONMENT DIVISION.
       CONFIGURATION SECTION.
       REPOSITORY.
           CLASS A-CLASS AS "AClass"
           .
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01  WS-OBJECT-1  OBJECT REFERENCE A-CLASS.
       01  WS-OBJECT-2  OBJECT REFERENCE A-CLASS.
       PROCEDURE DIVISION.
            DISPLAY " "
            DISPLAY "Count per the class:  " A-CLASS:>getCount
            DISPLAY " "

            DISPLAY "Creating instance 1...."
            SET WS-OBJECT-1 TO A-CLASS:>new
            DISPLAY "Count per the class:  " A-CLASS:>getCount
            DISPLAY "Count per instance 1: " WS-OBJECT-1:>getCount 
            DISPLAY "ID of instance 1:     " WS-OBJECT-1:>getID
            DISPLAY " "

            DISPLAY "Creating instance 2...."
            SET WS-OBJECT-2 TO A-CLASS:>new
            DISPLAY "Count per the class:  " A-CLASS:>getCount
            DISPLAY "Count per instance 1: " WS-OBJECT-1:>getCount 
            DISPLAY "Count per instance 2: " WS-OBJECT-2:>getCount 
            DISPLAY "ID of instance 1:     " WS-OBJECT-1:>getID
            DISPLAY "ID of instance 2:     " WS-OBJECT-2:>getID
            DISPLAY " "

            DISPLAY "Disposing of instance 1...."
            INVOKE WS-OBJECT-1 "dispose"
            SET    WS-OBJECT-1 TO NULL
            DISPLAY "Count per the class:  " A-CLASS:>getCount
            DISPLAY " "

            DISPLAY "Disposing of instance 2...."
            INVOKE WS-OBJECT-2 "dispose"
            SET    WS-OBJECT-2 TO NULL
            DISPLAY "Count per the class:  " A-CLASS:>getCount
            DISPLAY " "

            DISPLAY "Creating a new object for instance 1...."
            SET WS-OBJECT-1 TO A-CLASS:>new
            DISPLAY "Count per the class:  " A-CLASS:>getCount
            DISPLAY "Count per instance 1: " WS-OBJECT-1:>getCount 
            DISPLAY "ID of instance 1:     " WS-OBJECT-1:>getID
            DISPLAY " "

            DISPLAY "Disposing of instance 1 again...."
            INVOKE WS-OBJECT-1 "dispose"
            SET    WS-OBJECT-1 TO NULL
            DISPLAY "Count per the class:  " A-CLASS:>getCount
            DISPLAY " "

            GOBACK.
